home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / clang / sb02.zip / SB.DOC < prev    next >
Text File  |  1994-09-06  |  4KB  |  100 lines

  1.  
  2.     1.INTRODUCTION
  3.  
  4.     This is a package for recording and playing sounds on
  5.     a DOS machine, using djgpp. It uses buffered DMA play,
  6.     so in principle you can do what you like once you
  7.     started playing the sound. In this special version I
  8.     implemented a loop, waiting for a keypress and correctly
  9.     ending playing/recording. Look at the sb_play/sb_rec
  10.     routines. Everything in the 'while(sb_dma_active)' loop
  11.     is not vital and could be removed, including the while
  12.     itself. The calling function then would be responsible
  13.     for making sure if the sound is finished or not.
  14.     Of course, in that case the sb_cleanup_ints must also be
  15.     transferred to that function and be called AFTER all
  16.     playing is finished. You cannot just install the interrupts
  17.     at the start of the program and leave them hanging around,
  18.     as playing and recording use different interrupt routines!
  19.     Hopefully this is finally a stable version, I tested it
  20.     with all kinds of files in several environments and it
  21.     worked flawlessly.
  22.     Improvements or error reports to the following adress :
  23.     kordmann@ldv01.Uni-Trier.de
  24.  
  25.  
  26.     2.WHAT'S NEW
  27.  
  28.     02 : - added high speed DMA to correctly process sampling
  29.          rates above 37037 Hz
  30.          - changed memcpy to dosmem... to work under the new
  31.          dpmi supporting djgpp 1.12
  32.          - removed handmade getch()/kbhit(), as the library
  33.          versions meanwhile work flawlessly
  34.  
  35.  
  36.     3.SUPPORTED
  37.  
  38.     The program was written for an 8-bit Soundblaster or
  39.     compatible card. The data is therefore stored in an
  40.     array of unsigned char. 16 or 32 bit or whatever
  41.     samples won't work. Feel free to modify the code if
  42.     you need it, I don't know how to do it.
  43.     As it runs under go32, it allows you to record as much
  44.     sound as fits in your memory. If your machine has 8MB
  45.     and you want to record at 20KHz eg, that would make
  46.     about 5 minutes, depending on memory usage of your
  47.     program, TSRs and the environment.
  48.  
  49.     4.USAGE
  50.  
  51.     ATTENTION : due to a bug in go32 1.11, your machine may
  52.     crash when you use these routines. There is a fix for
  53.     this by Grzegorz Jablonski. See patch.txt for it. This
  54.     is fixed in 1.12.
  55.  
  56.     Before anything else, call sb_init. It will return the
  57.     address of your soundcard if successful, 0 else.
  58.     In most cases, I guess, it will suffice to use the two
  59.     routines SoundPlay and SoundRec, both with the
  60.     parameters  Rate : int, the sampling rate
  61.             data : unsigned char *, where the sound is
  62.             stored. Must be allocated before calling
  63.             SoundPlay or SoundRec
  64.             length : unsigned long, length of data in byte
  65.     When you don't need the functions anymore, or before leaving
  66.     the program, call sb_cleanup to free the memory used.
  67.  
  68.     The included program main.c gives a short example how to
  69.     calculate length and how to call the functions.
  70.     Usage is : main [<filename.wav>] [-r [-f<samplingrate>][-t<time>]]
  71.  
  72.     filename : if not given defaults to 'test.wav'
  73.     -r : recording mode. Only then the other options are valid
  74.     -f : sampling rate (or frequency) in Hertz (samples per second)
  75.          defaults to 12000
  76.     -t : recording time in miliseconds, defaults to 2000
  77.  
  78.     5.FILES
  79.  
  80.     sb.c : the library routines as such
  81.     sb.h : header file for the library
  82.     main.c : example program for recording and playing .wav files
  83.     wave.c : routines for reading and writing .wav files
  84.     makefile : makes the example program using gcc, executable sound
  85.     patch.txt : contains a bugfix for go32 1.11.maint5
  86.  
  87.     6.ERRORS
  88.  
  89.     I did not test it under windows. As this marvellous ;->
  90.     product crashes about everything there might be some kind
  91.     or the other of a problem...
  92.  
  93.     7. THANKS
  94.  
  95.     The basic code is mainly from David Baggett, who again based
  96.     it on SoundBlaster Freedom project and linux code. Without
  97.     the bugfixes of Grzegorz Jablonski nothing would have been
  98.     possible, and of course without D.J.Delories port of the
  99.     gcc compiler written by... and so on
  100.